﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace Warp9
{
    class World
    {
        public Terrain Terrain;
        private int _size;
        private float _scale;
        //private float _gravity;

        public World(int size)
        {
            changeSize(_size);
            this._scale = 1f;
            this.Terrain = GenerateTerrain();
            //this._gravity = 1f;
        }
        public void Reset(int difference)
        {
            changeSize(_size + difference);
            this.Terrain = GenerateTerrain();
        }
        private Terrain GenerateTerrain()
        {
            return new Terrain(_size, _scale);
        }

        private void changeSize(int newSize)
        {
            int minimumsize = 100, maximumSize = 5000;
            _size = (int)MathHelper.Clamp(newSize, minimumsize, maximumSize);
        }

        public  int GetSize()
        {
            return _size;
        }

    }
}
